package cwinsor.raking.year2014;

public class PropertyVirtualPreferenceChange extends PropertyVirtual {

	public PropertyBase prototype() {
		PropertyBase prototype = new PropertyVirtualPreferenceChange();
		return prototype;
	}

	public Object getValue() {
		Boolean changed = !toInteger().equals(0);
		return changed;
	}

	public Integer toInteger() {
		PROP_E[] oldPref = PROP_E.lastPrefsList();
		PROP_E[] newPref = PROP_E.curPrefsList();

		for (int i = 0; i < oldPref.length; i++) {
			if (newPref[i] != oldPref[i]) {
				return 1;
			}
		}
		return 0;
	}

	public String toString() {
		Integer temp = toInteger();
		String tempS = temp.toString();
		return tempS;
	}


	public int compareTo(PropertyBase arg0) {
		return toInteger() - arg0.toInteger();
	}

	// debug
	String dM = this.getClass().getSimpleName();
}
